Match repo file lookups case-insensitively - #12
Merged
Conversation
README / LICENSE / CONTRIBUTING casing varies in the wild (readme.md, Readme.md, README.MD). Exact-match lookups scored those files as missing on case-sensitive filesystems, so Linux CI and a macOS dev box disagreed on the same commit — and the deployed numbers were the wrong ones. vercel/next.js, expressjs/express, nestjs/nest and five other tracked repos were recorded as having no README at all; next.js was under-scored by 18.5 points. Signal path lookups now go through case-folding resolvers in helpers.ts. resolveAllRelative dedupes by resolved path so a candidate list carrying two spellings of one file (Makefile / makefile) cannot count twice — on a case-insensitive filesystem that had been inflating dev_env to 1.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Agent Friendly Code — score diffOverall: 91.0 → 91.0 (±0.0) Per model
No signals changed between base and head. Posted by agent-friendly-action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
readme.md,Readme.md, andREADME.MDall countas a README. Eight tracked repos — including
vercel/next.js,expressjs/express, andnestjs/nest—were recorded as having no README at all.
next.jswas under-scored by 18.5 points;JetBrains/kotlinanddirectus/directuslikewise./methodologynow states the matching rule so maintainers can see why a file counts.Motivation
Scores are the product.
firstExistingusedexistsSync(join(repo, candidate)), which is exact-match.README / LICENSE / CONTRIBUTING casing varies genuinely in the wild, so on a case-sensitive filesystem
those files read as missing.
The scheduled rescore runs on
ubuntu-latest, so the wrong values are the ones indata/rank.dband onthe live leaderboard. macOS masked it locally —
existsSync("README.md")happily matchesReadme.mdthere — which is why it survived this long.
Not a roadmap item; an unplanned correctness bug found while scoping on-the-fly scoring.
Changes
lib/scoring/signals/helpers.ts— case-folding resolver behindfirstExisting, plusresolveRelativeand
resolveAllRelative. Exact spelling wins so an exact match is never shadowed by a differently-casedsibling; entries are sorted so a genuine
README.md+readme.mdcollision resolves identically every run.existsSync(join(repo, …)).resolveAllRelativededupes by resolved path — a candidate list carrying two spellings of one file mustnot count twice. Without this,
Makefile+makefileindev_env's list would have counted as twoartifacts and pushed the signal from 0.7 to 1.0.
makefile,Tests); foldedgemini-md's hand-rolled case-insensitivescan into the shared resolver.
.csproj/.cabal/.nimble/.mdc/.ya?ml.app/methodology/page.tsx— matching rule stated in the Signals panel and in the FAQ JSON-LD.AGENTS.md— Conventions bullet requiring the resolvers over rawexistsSync, new test file listed,"Adding a signal" points at it.
Testing
bun run test— 179/179 (was 166; +13 covering case-insensitivity, resolved-path dedupe, and repo-root escape).bun x tsc --noEmit,biome check .— clean (3 pre-existingnoImgElementwarnings in badge components, untouched).bun run score .end-to-end;next buildcompiles,/methodologystill static.spelled the way next.js spells its files. Old logic:
existsSyncfalse for all ofREADME.md/LICENSE/LICENSE.md/CONTRIBUTING.md/CONTRIBUTING. New logic:readme,license,contributingallpass=1.makes them fail pre-fix on a case-insensitive filesystem too.